package oj;

import java.util.Scanner;

public class Day34F {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
            int n=Integer.parseInt(sc.nextLine());
            String[] str=new String[n];
            for(int i=0;i<n;i++){
                str[i]=sc.nextLine();
            }
            System.out.println(name(str));
        }
    }
    private static String name(String[] str){
        StringBuilder sb=new StringBuilder();
        for(int i=0;i<str.length;i++){
            if(str[i].contains(",")||str[i].contains(" ")){
                sb.append("\"");
                sb.append(str[i]);
                sb.append("\"");
            }else{
                sb.append(str[i]);
            }
            if(i!=str.length-1){
                sb.append(", ");
            }
        }
        return sb.toString();
    }
}